using System;
using System.Collections.Generic;
using System.Text;
using ReactiveUI;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;
using SCTO.Center;

namespace testapp.ViewModels
{
    public class MainWindowViewModel : ViewModelBase
    {
        public string Greeting => "Welcome to Avalonia!";

        private bool fileDetailOpened;
        private string fileDetialName;
        private List<ClientInfo>? clientInfos;
        private List<FileInfoViewModel> fileList;
        private ClientInfo? selectedClient;

        public MainWindowViewModel() : base()
        {
            fileDetailOpened = false;
            fileDetialName = "test.txt";
            clientInfos = new();
            fileList = new();
        }

        public ClientInfo? SelectedClient
        {
            get => selectedClient;
            set => this.RaiseAndSetIfChanged(ref selectedClient, value);
        }

        public bool FileDetailOpened
        {
            get => fileDetailOpened;
            set => this.RaiseAndSetIfChanged(ref fileDetailOpened, value);
        }

        public string FileDetailName
        {
            get => fileDetialName;
            set => this.RaiseAndSetIfChanged(ref fileDetialName, value);
        }

        public List<ClientInfo>? ClientInfos
        {
            get => clientInfos;
            set => this.RaiseAndSetIfChanged(ref clientInfos, value);
        }

        public List<FileInfoViewModel> FileList
        {
            get => fileList;
            set => this.RaiseAndSetIfChanged(ref fileList, value);
        }
    }
}
